package com.kb.design.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kb.design.common.ApiResponse;
import com.kb.design.common.ResponseObject;
import com.kb.design.dto.BonusConfigDTO;
import com.kb.design.dto.DesignProjectDTO;
import com.kb.design.entity.BonusConfig;
import com.kb.design.entity.DesignResponsiblePerson;
import com.kb.design.service.BonusConfigService;
import com.kb.design.service.ResponsiblePersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/responsiblePerson")
public class ResponsibleController {

    @Autowired
    private ResponsiblePersonService personService;

    /**
     * 下一个负责人
     * @param
     * @return
     */
    @PostMapping("/nextTask")
    public ApiResponse nextTask(@RequestBody DesignResponsiblePerson designResponsiblePerson) {
        return ApiResponse.success(personService.nextTask(designResponsiblePerson));
    }
    /**
     * 项目进行中确认
     *
     * @param
     * @
     */
    @PostMapping("/projectConfirmed")
    public ApiResponse projectConfirmed(@RequestBody DesignProjectDTO projectDTO) {

        return ApiResponse.success( personService.projectConfirmed(projectDTO));
    }
    /**
     * 项目完成
     *
     * @param
     * @
     */
    @PostMapping("/projectCompleted")
    public ApiResponse projectCompleted(@RequestBody DesignProjectDTO projectDTO) {

        return ApiResponse.success( personService.projectCompleted(projectDTO));
    }
    /**
     * 项目节点信息
     *
     * @param
     * @
     */
    @PostMapping("/getProjectNodeInfo")
    public ApiResponse getProjectNodeInfo(@RequestBody DesignProjectDTO projectDTO) {
        return ApiResponse.success( personService.getProjectNodeInfo(projectDTO));
    }
    /**
     * 项目基本信息修改
     *
     * @param
     * @
     */
    @PostMapping("/updateProjectInfo")
    public ApiResponse updateProjectInfo(@RequestBody DesignProjectDTO projectDTO) {

        return ApiResponse.success( personService.updateProjectInfo(projectDTO));
    }
    /**
     * 头部节点信息
     *
     * @param
     * @
     */
    @GetMapping("/queryHeadInfo")
    public ApiResponse queryHeadInfo(String projectId) {
        return ApiResponse.success( personService.queryHeadInfo(projectId));
    }
}
